import request from '@/utils/request'

// 获取商品详情
export function travelInfoDetail(params, showLoading=true){
  return request({
    url: `/travel/info/travelInfoDetail`,
    method: 'GET',
    showLoading,
    params
  })
}

// 获取产品列表
export function travelInfoList(data, showLoading=true) {
  return request({
    url: `/travel/info/travelInfoList`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    showLoading,
    data
  })
}

// 获取商品详情
export function getTravelType(params, showLoading=true){
  return request({
    url: `/travel/common/getTravelType`,
    method: 'GET',
    showLoading,
    params
  })
}

// 获取轮播图
export function getSlideShow(params, showLoading=true) {
  return request({
    url: `/travel/picture/getSlideShow`,
    method: 'GET',
    showLoading,
    params
  })
}

// 收藏
export function addCollect(data, showLoading=true) {
  return request({
    url: `/travel/travelCollect/addCollect`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    showLoading,
    data
  })
}

// 取消收藏
export function deleteCollect(data, showLoading=true) {
  return request({
    url: `/travel/travelCollect/deleteCollect`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    showLoading,
    data
  })
}

export function collectPage(data, showLoading=true) {
  return request({
    url: `/travel/travelCollect/collectPage`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    showLoading,
    data
  })
}

//travel/common/downloadContract
export function downloadContract() {
  window.open('/travel/common/downloadContract')
}

